import service from '@/utils/request'

export const useProcess_statesApi = (id: number) => {
	return service.get('/project/process-states/' + id)
}

export const useProcess_getStepStates = (projectId: number, stepId: number) => {
	return service.get(`/project/process-states/${projectId}/${stepId}`)
}

export const useProjectProcessStates = (projectId: number) => {
	return service.get(`/project/process-states/project?projectId=${projectId}`)
}

export const useProcess_statesSubmitApi = (dataForm: any) => {
	if (dataForm.id) {
		return service.put('/project/process-states', dataForm)
	}
}

export const getSatesSelect = (projectId: number) => {
	return service.get(`/project/process-states/status?projectId=${projectId}`)
}

export const updateProcessStatus = (projectId: number, stepId: number) => {
	return service.post('/project/process-states/status/update', { projectId, stepId })
}
export const resetProcessStatus = (id: number) => {
	return service.put('/project/process-states/reset', { id })
}
